package io.bitmax.exchange.core;

import io.bitmax.library.mvp.BaseFragmentPresenter;
import io.bitmax.library.mvp.BaseMVPFragment;
import io.bitmax.library.mvp.IBaseUI;

/**
 * Created by gongdongyang on 2018/9/18.
 */

public abstract class BaseFragment<P extends BaseFragmentPresenter<V>,V extends IBaseUI> extends BaseMVPFragment<P,V>
        implements  IBaseUI {

    @Override
    protected void executeOnceAfterCreateView() {
        super.executeOnceAfterCreateView();
        initView();
        addEvent();
    }

    @Override
    public void showProgressDialog(String title, String hint) {
        if (getActivity() instanceof IBaseUI)
            ((IBaseUI) getActivity()).showProgressDialog(title, hint);
    }

    @Override
    public void dismissProgressDialog() {
        if (getActivity() instanceof IBaseUI) {
            ((IBaseUI) getActivity()).dismissProgressDialog();
        }
    }
}
